package course;

import org.junit.*;

/**
 * @author zouran
 * createDate：2024/4/16  13:26
 */
public class TriangleTest_ {

    @BeforeClass
    public static void beforeClassTriangle() {
//        System.out.println("beforeClass");
    }

    @AfterClass
    public static void afterClassTriangle() {
//        System.out.println("afterClass");
    }

    @Before
    public void beforeTriangle() {
//        System.out.println("before");
    }

    @After
    public void afterTriangle() {
//        System.out.println("after");
    }

    @Test
    public void testTriangle() {
//        System.out.println("三角形");
        Assert.assertTrue("是三角形", new Triangle(3, 4, 5).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(0, 1, 2).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(1, 0, 2).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(1, 2, 0).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(1, 2, 3).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(1, 3, 2).isTriangle());
        Assert.assertFalse("不是三角形", new Triangle(3, 1, 2).isTriangle());
    }

    @Test
    public void testIsoscelesTriangle() {
//        System.out.println("等腰三角形");
        Assert.assertTrue("是等腰三角形", new Triangle(3, 3, 4).isIsoscelesTriangle());
        Assert.assertTrue("是等腰三角形", new Triangle(3, 4, 4).isIsoscelesTriangle());
        Assert.assertTrue("是等腰三角形", new Triangle(3, 4, 3).isIsoscelesTriangle());
        Assert.assertFalse("不是等腰三角形", new Triangle(3, 4, 5).isIsoscelesTriangle());
    }

    @Test
    public void testIsEquilateralTriangle() {
//        System.out.println("等边三角形");
        Assert.assertTrue("是等边三角形", new Triangle(3, 3, 3).isEquilateralTriangle());
        Assert.assertFalse("不是等边三角形", new Triangle(3, 4, 4).isEquilateralTriangle());
        Assert.assertFalse("不是等边三角形", new Triangle(3, 4, 3).isEquilateralTriangle());
        Assert.assertFalse("不是等边三角形", new Triangle(3, 3, 4).isEquilateralTriangle());
    }
}
